<?php
include_once('pownceapi.class.php');
print '<pre>';

$key = 'key';
$secret = 'secret';
$pownceAPI = new pownceApi('oauth', $key, $secret);

$token = $pownceAPI->getNewRequestToken();
print '<a href="' . $pownceAPI->getOauthAuthorizeUrl() . '&oauth_callback='. urlencode($pownceAPI->getOauthCallbackUrl() .'?token='. $token['oauth_token'] .'&token_secret='. $token['oauth_token_secret']) . '"> Authorize</a>';

/*
$token        = $_GET['token'];
$token_secret = $_GET['token_secret'];
*/

$access_token = $pownceAPI->getNewOauthAccessToken($token, $token_secret);
//Your ccess token information should be stored somewhere and tied to some type of user

print_r($access_token);

/*
$token        = '638cdfgsdfgoj7bb';
$token_secret = 'ddfgdfgsd44s7hgj';
*/

$pownceAPI->verifyOauthAccess($token, $token_secret); //Access Token Information

$pownceAPI->getSendToList();

if(!empty($_FILES))
{
  $path = '/tmp/';
  $path .= basename($_FILES['file']['name']);
  move_uploaded_file($_FILES['file']['tmp_name'], $path);
  $pownceAPI->sendFile('friend_178535', $path);
}
?>

<form enctype="multipart/form-data" action="" method="POST">

<input name="file" type="file"></input>
<input type="submit">

</form>